#Description:modify image f from f lists
#Author:honglou(hongloull@hotmail.com)
#Create:2008.03.07
#Update:2008.03.07
#How to use :
import os
import sys
import traceback

def imageResize_lms(size,f):
    for x in get_files(d) :
        if x.endswith('.TGA') or x.endswith('.tga') or x.endswith('.tif') or x.endswith('.TIF'):
            try:
                #cmd = 'imconvert ' + f + ' -resize 2048x2048>50% -quality 100 ' + f_l
                cmd = '"C:/Program Files/Autodesk/Maya2012/bin/imconvert" ' + f + ' -resize %sx%s ' % (size,size) + f
                os.popen( cmd )
            except:
                traceback.print_exc()
            else:
                pass
            
def get_files(d):
    import glob
    return (x for x in glob.glob('%s/*' % d)) 
        
if __name__ == "__main__" :
    imageResize_lms( sys.argv[1] )
